get name of parent dir php

35

<?php
  //OUTPUT name of the parent dir no forward or backward slashes
  //USAGE add the code below to the script you need the parent DIR of, that simple.
  basename(__DIR__);
  //OUTPUT: parentDIR 
?>

Comments

Submit
0 Comments